﻿@namespace BlazorStrap
@inherits BSToastBase

@*
Use With:
	

<div aria-live="polite" aria-atomic="true" style="position: relative; min-height: 200px;">
	<!-- Position it -->
	<div style="position: absolute; top: 0; right: 0;">

		<!-- Then put toasts within -->
	</div>
</div>
*@

<DynamicElement TagName="div" class="@Classname" role="alert" aria-live="assertive" aria-atomic="true" @attributes="@UnknownParameters">
	<div class="toast-header">
		@if (!string.IsNullOrWhiteSpace(ImgSrc))
		{
			<img src="@ImgSrc" class="rounded mr-2" alt="@ImgDescription">
		}
		<strong class="mr-auto">@BSToastHeader</strong>
		@if (TimeStamp.HasValue)
		{
			//ToDo: For best results, use "PrettyDate" C# Extension on `DateTime.ToString()`
			<small class="text-muted">@TimeStamp.Value.ToString(DateFormat)</small>
		}
		<button @onclick="OnClick" type="button" class="ml-2 mb-1 close" aria-label="Close">
			<span aria-hidden="true">&times;</span>
		</button>
	</div>
    <div class="toast-body">
        @BSToastBody
    </div>
</DynamicElement>
